package hipt.com.service.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import hipt.com.dao.AssetDao;
import hipt.com.model.Asset;
import hipt.com.service.AssetService;

@Service("assetService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class AssetServiceImpl implements AssetService {
	@Autowired
	private AssetDao assetDao;
	@Override
	public void deleteAsset(Asset asset) {
		assetDao.deleteAsset(asset);
	}

	@Override
	public Asset getAssetByAssetId(Integer assetId) {
		return assetDao.getAssetByAssetId(assetId);
	}

	@Override
	public List<Asset> getAssetByUserId(Long userId) {
		return assetDao.getAssetByUserId(userId);
	}

	@Override
	public List<Asset> listAssets() {
		return assetDao.listAssets();
	}

	@Override
	public void saveAsset(Asset asset) {
		assetDao.saveAsset(asset);
	}

	@Override
	public void updateAsset(Asset asset) {
		assetDao.updateAsset(asset);
	}

	@Override
	public List<Asset> getAssetByCatId(Long catId) {
		return assetDao.getAssetByCatId(catId);
	}

}
